import os
import pyperclip
import uiautomation
from config.config import DATA_PATH
from page.index import IndexPage
from page.门诊医生站.门诊医生站.menzhenyishengzhan__page import menzhenyishengzhan
from page.门诊医生站.门诊医生站.menzhenyishengzhanfuwudengji__page import fuwudengji

from tools.sjqd_way import read_data_from_excel, write_data_from_excel
class Fuwudengji():
    his = uiautomation.WindowControl(searchDepth=1, Name='科玛奇医院信息管理系统')  # 锁定窗口
    his.SetFocus()
    def fuwudengji(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "创建患者")
        fwks,doctor,adress = self.data[0]
        ap = IndexPage()
        bp = menzhenyishengzhan()
        cp = fuwudengji()
        ap.click_mzysz1_btn()
        ap.click_mzysz_btn()
        bp.click_fuwudengji_btn()
        cp.creat_hz(fwks,doctor,adress)#创建患者
        # ceshihuanzhe = pyperclip.paste()
        # write_data_from_excel(ceshihuanzhe)
if __name__ == '__main__':
    Fuwudengji().fuwudengji()
